package main

import (
	"app/api"
	"app/wd"
	"app/wd/middleware"
	"fmt"

	"github.com/gin-gonic/gin"
)

func main() {
	wd.App.SysLog.WithField("type", "sys").Info("启动项目")
	r := gin.Default()
	r.Use(middleware.LogMiddleware(), middleware.SetCustomRecovery())
	api.RegisterAPI(r)
	go func() {
		r.Run(fmt.Sprintf(":%d", wd.App.Config.Get("app.port"))) // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
	}()
	wd.App.Signal()
}
